# -*- coding: utf-8 -*-
'''
    :file: schema.py
    :author: -Farmer
    :url: https://blog.farmer233.top
    :date: 2021/04/25 18:25:25
'''
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema, auto_field
from app.models import LogMsg

# ORM序列化模型
class LogMsgSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = LogMsg

    id = auto_field()
    username = auto_field()
    host = auto_field()
    port = auto_field()
    api_msg = auto_field()
    ctr_lv = auto_field()
    is_admin = auto_field()
    log_time = auto_field()

# class BookSchema(ma.SQLAlchemyAutoSchema):
#     class Meta:
#         model = Book
#         include_fk = True